package com.google.code.stalkernet.peer;

import com.google.code.stalkernet.message.Message;
import com.google.code.stalkernet.node.NodeID;
import com.google.code.stalkernet.peer.event.PeerListener;


/**
 * Represents remote Stalker.Net peer.
 *
 * @author Mikhail Vladimirov
 */
public interface Peer
{
    /**
     * Add listener to be notified about peer-related events.
     *
     * @param peerListener listener to be added
     */
    public void addPeerListener (PeerListener peerListener);

    /**
     * Remove listener notified about peer-related events.
     *
     * @param peerListener listener to be removed
     */
    public void removePeerListener (PeerListener peerListener);

    public NodeID getRemoteNodeID ();

    /**
     * Send message to the peer.
     *
     * @param message message to be sent
     */
    public void sendMessage (Message message);

    /**
     * Disconnect peer.
     */
    public void disconnect ();
}
